package com.guangfeng.yql.comm.netty.chatroom.messageImpl;

import com.guangfeng.yql.comm.netty.annotation.AChatRoomMessage;
import com.guangfeng.yql.comm.netty.chatroom.ChatRoomMessage;
import com.guangfeng.yql.comm.netty.enumerate.ChatRoomMessageType;
import com.guangfeng.yql.comm.netty.util.ChatRoomUtil;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import org.springframework.stereotype.Component;

@AChatRoomMessage(ChatRoomMessageType.quitChatRoot)
@Component
public class QuitChatRoom extends ChatRoomMessage {

    @Override
    public void tactics(ChannelHandlerContext ctx, TextWebSocketFrame msg) {
        ChatRoomUtil.quitChatRoom(ctx.channel());
    }
}
